#!/bin/sh
set -ex
echo $HOSTNAME
if [ "$(echo $HOSTNAME |wc -c)" -ge "15" ];then
      HOSTNAME="$(echo $HOSTNAME | cut -c 49-64)"
fi
echo $HOSTNAME
[ -d /data/logs ] && rm -rf /data/logs
[ -d /data/gfs/${HOSTNAME} ] || /bin/mkdir -p /data/gfs/${HOSTNAME}
[ ! -L /data/logs ] && ln -s /data/gfs/${HOSTNAME} /data/logs
exec "$@"
